/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package EA_Model.IEC61970.SCADA.impl;

import EA_Model.IEC61970.SCADA.RemoteControl;
import EA_Model.IEC61970.SCADA.SCADAPackage;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Remote Control</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link EA_Model.IEC61970.SCADA.impl.RemoteControlImpl#getActuatorMaximum <em>Actuator Maximum</em>}</li>
 *   <li>{@link EA_Model.IEC61970.SCADA.impl.RemoteControlImpl#getActuatorMinimum <em>Actuator Minimum</em>}</li>
 *   <li>{@link EA_Model.IEC61970.SCADA.impl.RemoteControlImpl#getRemoteControlled <em>Remote Controlled</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class RemoteControlImpl extends RemotePointImpl implements RemoteControl {
	/**
	 * The cached value of the '{@link #getActuatorMaximum() <em>Actuator Maximum</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getActuatorMaximum()
	 * @generated
	 * @ordered
	 */
	protected EA_Model.IEC61970.Domain.Float actuatorMaximum;

	/**
	 * The cached value of the '{@link #getActuatorMinimum() <em>Actuator Minimum</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getActuatorMinimum()
	 * @generated
	 * @ordered
	 */
	protected EA_Model.IEC61970.Domain.Float actuatorMinimum;

	/**
	 * The cached value of the '{@link #getRemoteControlled() <em>Remote Controlled</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getRemoteControlled()
	 * @generated
	 * @ordered
	 */
	protected EA_Model.IEC61970.Domain.Boolean remoteControlled;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected RemoteControlImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return SCADAPackage.Literals.REMOTE_CONTROL;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.Float getActuatorMaximum() {
		if (actuatorMaximum != null && actuatorMaximum.eIsProxy()) {
			InternalEObject oldActuatorMaximum = (InternalEObject)actuatorMaximum;
			actuatorMaximum = (EA_Model.IEC61970.Domain.Float)eResolveProxy(oldActuatorMaximum);
			if (actuatorMaximum != oldActuatorMaximum) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, SCADAPackage.REMOTE_CONTROL__ACTUATOR_MAXIMUM, oldActuatorMaximum, actuatorMaximum));
			}
		}
		return actuatorMaximum;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.Float basicGetActuatorMaximum() {
		return actuatorMaximum;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setActuatorMaximum(EA_Model.IEC61970.Domain.Float newActuatorMaximum) {
		EA_Model.IEC61970.Domain.Float oldActuatorMaximum = actuatorMaximum;
		actuatorMaximum = newActuatorMaximum;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, SCADAPackage.REMOTE_CONTROL__ACTUATOR_MAXIMUM, oldActuatorMaximum, actuatorMaximum));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.Float getActuatorMinimum() {
		if (actuatorMinimum != null && actuatorMinimum.eIsProxy()) {
			InternalEObject oldActuatorMinimum = (InternalEObject)actuatorMinimum;
			actuatorMinimum = (EA_Model.IEC61970.Domain.Float)eResolveProxy(oldActuatorMinimum);
			if (actuatorMinimum != oldActuatorMinimum) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, SCADAPackage.REMOTE_CONTROL__ACTUATOR_MINIMUM, oldActuatorMinimum, actuatorMinimum));
			}
		}
		return actuatorMinimum;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.Float basicGetActuatorMinimum() {
		return actuatorMinimum;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setActuatorMinimum(EA_Model.IEC61970.Domain.Float newActuatorMinimum) {
		EA_Model.IEC61970.Domain.Float oldActuatorMinimum = actuatorMinimum;
		actuatorMinimum = newActuatorMinimum;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, SCADAPackage.REMOTE_CONTROL__ACTUATOR_MINIMUM, oldActuatorMinimum, actuatorMinimum));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.Boolean getRemoteControlled() {
		if (remoteControlled != null && remoteControlled.eIsProxy()) {
			InternalEObject oldRemoteControlled = (InternalEObject)remoteControlled;
			remoteControlled = (EA_Model.IEC61970.Domain.Boolean)eResolveProxy(oldRemoteControlled);
			if (remoteControlled != oldRemoteControlled) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, SCADAPackage.REMOTE_CONTROL__REMOTE_CONTROLLED, oldRemoteControlled, remoteControlled));
			}
		}
		return remoteControlled;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.Boolean basicGetRemoteControlled() {
		return remoteControlled;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setRemoteControlled(EA_Model.IEC61970.Domain.Boolean newRemoteControlled) {
		EA_Model.IEC61970.Domain.Boolean oldRemoteControlled = remoteControlled;
		remoteControlled = newRemoteControlled;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, SCADAPackage.REMOTE_CONTROL__REMOTE_CONTROLLED, oldRemoteControlled, remoteControlled));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case SCADAPackage.REMOTE_CONTROL__ACTUATOR_MAXIMUM:
				if (resolve) return getActuatorMaximum();
				return basicGetActuatorMaximum();
			case SCADAPackage.REMOTE_CONTROL__ACTUATOR_MINIMUM:
				if (resolve) return getActuatorMinimum();
				return basicGetActuatorMinimum();
			case SCADAPackage.REMOTE_CONTROL__REMOTE_CONTROLLED:
				if (resolve) return getRemoteControlled();
				return basicGetRemoteControlled();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case SCADAPackage.REMOTE_CONTROL__ACTUATOR_MAXIMUM:
				setActuatorMaximum((EA_Model.IEC61970.Domain.Float)newValue);
				return;
			case SCADAPackage.REMOTE_CONTROL__ACTUATOR_MINIMUM:
				setActuatorMinimum((EA_Model.IEC61970.Domain.Float)newValue);
				return;
			case SCADAPackage.REMOTE_CONTROL__REMOTE_CONTROLLED:
				setRemoteControlled((EA_Model.IEC61970.Domain.Boolean)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case SCADAPackage.REMOTE_CONTROL__ACTUATOR_MAXIMUM:
				setActuatorMaximum((EA_Model.IEC61970.Domain.Float)null);
				return;
			case SCADAPackage.REMOTE_CONTROL__ACTUATOR_MINIMUM:
				setActuatorMinimum((EA_Model.IEC61970.Domain.Float)null);
				return;
			case SCADAPackage.REMOTE_CONTROL__REMOTE_CONTROLLED:
				setRemoteControlled((EA_Model.IEC61970.Domain.Boolean)null);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case SCADAPackage.REMOTE_CONTROL__ACTUATOR_MAXIMUM:
				return actuatorMaximum != null;
			case SCADAPackage.REMOTE_CONTROL__ACTUATOR_MINIMUM:
				return actuatorMinimum != null;
			case SCADAPackage.REMOTE_CONTROL__REMOTE_CONTROLLED:
				return remoteControlled != null;
		}
		return super.eIsSet(featureID);
	}

} //RemoteControlImpl
